ig.module( 
	'game.main' 
)
.requires(
	'impact.game',
	'impact.font',
		
	'game.levels.PickInside',
	
	'game.gameTypes.gameBase',	
	'game.gameTypes.gamePickInside'
)
.defines(function()
{
    MyGame = ig.Game.extend(
    {	
        // Load a font
        font: new ig.Font( 'media/04b03.font.png' ),
        currentGameName: '',
        currentGame: null,
            
        init: function()
        {
            ig.global.paused = false;
            
            // Initialize your game here; bind keys etc.
            ig.input.bind(ig.KEY.UP_ARROW, 'up');
            ig.input.bind(ig.KEY.DOWN_ARROW, 'down');
            ig.input.bind(ig.KEY.ENTER, 'enter');
                            
            ig.input.bind(ig.KEY.MOUSE1, 'mouse_left')
            ig.input.bind(ig.KEY.MOUSE3, 'mouse_right')
                            
            this.currentGameName = 'PickInside';
            
            switch (this.currentGameName)
            {
                    case 'PickInside':
                    {
                        this.currentGame = new GamePickInside();
                        this.loadLevel(LevelPickInside);
                    }
                    break;
            }
            
            this.currentGame.setGame(this);
            this.currentGame.postInit();
        },
            
        update: function()
        {
            if (this.firstUpdate == true)
            {
                    
            }
            
            if (ig.global.paused == true)
            {
                    this.currentGame.pausedUpdate();
                    return;
            }
            
            // Update all entities and backgroundMaps
            this.parent();
            
            // Add your own, additional update code here
            this.currentGame.update();
        },
            
        draw: function()
        {
            // Draw all entities and backgroundMaps
            this.parent();
            
            
            // Add your own drawing code here
            var x = ig.system.width/2,
                    y = ig.system.height/2;			
            
            this.currentGame.draw();
        }
});

    // Start the Game with 60fps, a resolution of 320x240, scaled
    // up by a factor of 2
    ig.main( '#canvas', MyGame, 60, 640, 480, 1 );
});
